import cv2 as cv
import numpy as np


def main():
    img = cv.imread('../data/jWithWhiteNoiseLeft.png')
    kernel = np.ones((5, 5), np.uint8)
    cv.morphologyEx(img, cv.MORPH_TOPHAT, kernel)
    opening = cv.morphologyEx(img, cv.MORPH_OPEN, kernel)
    imo = img - opening
    cv.imshow('Press any key to exit', imo)
    cv.waitKey(0)
    cv.destroyAllWindows()


if __name__ == "__main__":
    main()
